<?php
if($_GET["deid"]*1)
{
	$db->query("delete from ".EAR." where id='$_GET[deid]'");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE><?php echo lang_show('admin_system');?></TITLE> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/prototype.js"></script>
<script type="text/javascript" src="main.js"></script>
</HEAD>
<body>

<div class="bigbox">
		<div class="bigboxhead tb">
		<span class="cbox on"><a href="module.php?m=company&s=earnest_list.php">管理保证金</a></span>
		<span class="cbox"><a href="module.php?m=company&s=earnest_add.php">填加保证金</a></span>
	</div>
	<div class="bigboxbody">
  <table width="100%" border="0" cellpadding="2" cellspacing="0" >
    <tr class="theader"> 
      <td width="116">会员名</td>
      <td width="188"><?php echo lang_show('business_info_com');?></td>
      <td width="228">金额</td>
      <td width="145">交纳时间</td>
      <td width="145">负责人</td>
      <td width="108" align="center"><?php echo lang_show('manager');?></td>
      </tr>
    <?php
	$sql="SELECT a.*,b.company,b.user FROM ".EAR." a,".USER." b WHERE
	  	a.userid=b.userid order by id desc ";
	//=============================
	include_once("../includes/page_utf_class.php");
	$page = new Page;
	$page->listRows=20;
	if (!$page->__get('totalRows')){
		$db->query($sql);
		$page->totalRows = $db->num_rows();
	}
	$sql .= "  limit ".$page->firstRow.",20";
	$pages = $page->prompt();
	//=====================
	$db->query($sql);
	$re=$db->getRows();
	foreach($re as $v)
	{ 
	?> 
      <tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this,'odd')"> 
        <td><?php echo $v["user"]; ?></td>
        <td align="left"><?php echo $v["company"]; ?></td>
        <td align="left"><?php echo $v["money"]; ?></td>
        <td align="left"><?php echo date("Y-m-d",$v["time"]); ?></td>
        <td align="left"><?php echo $v["admin"]; ?></td>
        <td align="center"> 
        <a href="module.php?m=company&s=earnest_add.php&name=<?php echo $v['user']; ?>"><?php echo $editimg;?></a>  
        <a href="module.php?m=company&s=earnest_list.php&deid=<?php echo $v["id"]; ?>" onClick="return confirm('<?php echo lang_show('are_you_sure');?>')"><?php echo $delimg;?></a>
		</td>
	  </tr>
        <?php 
    	}
		?>
      <tr>
        <td colspan="6" align="right"><div class="page"><?php echo $pages?></div></td>
      </tr>
  </table>
  </div>
</div>
</body>
</html>
